﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Office.Interop.Excel;
using ExcellData;
using System.Collections;

namespace ExcelUtilities12
{
	public class Sheets12 : ISheets
	{
		private Sheets _Sheets;

		public Sheets12(Sheets sheets)
		{
			_Sheets = sheets;
		}

		public object this[int index]
		{
			get
			{
				return _Sheets[index];
			}
		}

		public IEnumerator GetEnumerator()
		{
			List<IWorksheet> sheets = null;

			if (_Sheets.Count > 0)
			{
				sheets = new List<IWorksheet>();
				foreach (var sheet in _Sheets)
				{
					sheets.Add(new Worksheet12((Worksheet)sheet));
				}
			}

			return sheets.GetEnumerator();
		}
	}
}
